from enum import unique

from myapp.const.base import TEnum
from myapp.const.mq import SlowTopicPrefix


# Message queue key for when an evaluation task is created.
MsgKeyTaskCreated = SlowTopicPrefix + 'evaluation_task_created'
# Message queue key for submitting evaluation results.
MsgKeyTaskSubmit = 'evaluation_task_submit'  # 提交评测结果
# Message queue key for an inference task within evaluation.
MsgKeyTaskInfer = SlowTopicPrefix + 'evaluation_task_infer'  # 推理任务
# Message queue key for when an inference task within evaluation is completed.
MsgKeyTaskInferDone = SlowTopicPrefix + 'evaluation_task_infer_done'  # 推理任务完成
# Message queue key for retrying an evaluation task.
MsgKeyTaskRetry = SlowTopicPrefix + 'evaluation_task_retry'  # 任务重试


# Defines an enumeration for various evaluation task statuses.
@unique
class EnumEvaluationTaskStatus(TEnum):
    # Indicates that the task is pending or queued.
    pending = 'pending'  # 排队中
    # Indicates that the task is running, calling a large model for inference results.
    running = 'running'  # 调用大模型获取推理结果中
    # Indicates that the inference call is complete.
    done = 'done'  # 调用推理完成
    # Indicates that the task is currently being evaluated.
    evaluating = 'evaluating'  # 评测中
    # Indicates that the evaluation is complete and the task has been submitted.
    submit = 'submit'  # 评测完成、任务提交
    # Indicates that the evaluation results have been generated.
    resulted = 'resulted'  # 评测结果生成完成
    # Indicates that the task has failed.
    failed = 'failed'  # 失败


# Defines an enumeration for the status of an evaluation dataset.
@unique
class EnumEvaluationDatasetStatus(TEnum):
    # Indicates that the dataset has not yet been evaluated.
    un_evaluated = 'un_evaluation'  # 未评测
    # Indicates that the dataset has been evaluated.
    evaluated = 'evaluated'  # 已评测
    # Indicates that the model call for evaluation failed.
    failed = 'failed'  # 调用模型失败


# Defines an enumeration for different types of evaluation tasks.
@unique
class EnumEvaluationTaskType(TEnum):
    # Represents a single evaluation task.
    single = 'single'  # 单个评测
    # Represents a comparative evaluation task.
    compare = 'compare'  # 对比评测


# Defines an enumeration for different modes of evaluation tasks.
@unique
class EnumEvaluationTaskMode(TEnum):
    # Represents an automatic evaluation mode.
    auto = 'auto'  # 自动评测
    # Represents a manual evaluation mode.
    manual = 'manual'  # 人工评测